package com.nwpu.coursesupport.service.imple;


import com.nwpu.coursesupport.entity.CourseTarget;
import com.nwpu.coursesupport.entity.EvaluationOfCourseTargetEntity;
import com.nwpu.coursesupport.mapper.CourseTargetDao;
import com.nwpu.coursesupport.mapper.EvaluationOfCourseTargetDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 *
 * @author shun
 * @email ws2017303035@mail.nwpu.edu.cn
 * @date 2020-08-04 21:33:50
 */
@Service
public class EvaluationOfCourseTargetService  {
    @Autowired
    private EvaluationOfCourseTargetDao evaluationOfCourseTargetDao;
    @Autowired
    private CourseTargetDao courseTargetDao;

    public List<EvaluationOfCourseTargetEntity> evaluationsByCourseId(Integer courseId) {
        List<CourseTarget> courseTargetList = courseTargetDao.findByCourseId(courseId);//找到课程目标列表
        int courseTargetId = courseTargetList.get(0).getId();//找到其中一个课程目标id
        return evaluationOfCourseTargetDao.findByCourseTargetId(courseTargetId);//根据课程目标id找到评价方式列表

    }

}

